// TestAbstractBase.cpp : main project file.

#include "stdafx.h"
#include "DerivedVC.h"

using namespace System;

typedef HRESULT (STDAPICALLTYPE* GetBaseVCFn)(CBaseVC**);

int main(array<System::String ^> ^args)
{
    CDerivedVC derivedVC;
	derivedVC.SayHello();


	HMODULE cppBuilderDerived = LoadLibrary(L"CppBuilderDerived.dll");

	if(cppBuilderDerived)
	{
		GetBaseVCFn fnPtr = (GetBaseVCFn)GetProcAddress(cppBuilderDerived, "GetCppBuilderDerived");
		if(fnPtr)
		{
			CBaseVC *derivedCppB = NULL;
			fnPtr(&derivedCppB);

			derivedCppB->SayHello();
			derivedCppB->Release();
		}
	}
	//delete derivedCppB;


    return 0;
}

